$(function(){
	$('.Search_Results_History').hover(function() {

        $(this).addClass('onhover');

      }, function() {

        $(this).removeClass('onhover');

      });
	});



$(document).ready(function()
		{
			$("#selectAllresult_History").click(function()
			{
                                var para="";
                                var v=document.getElementsByName("selectResult_History");
                                  for (i=0;i<v.length;i++)
                                    {
                                        v[i].checked=true;

                                        if (para!="")
						{
							para=para+","
						}
				para= para + v[i].value;


                                    }

                                setFilter_History("1",para);
			});
		});



$(document).ready(function()
		{
			$("#unselectAllresult_History").click(function()
			{

                                var v=document.getElementsByName("selectResult_History");
                                for (i=0;i<v.length;i++)
                                    {
                                        v[i].checked=false;
                                    }


                                setFilter_History("1","");
			});
		});


$(document).ready(function()
		{
			$("#clear_History").click(function()
			{
                            if (confirm("Do you want to clear History?")) {

                            window.sessionStorage.clear();
                            $("#history").html('<img src="/images/loading/loading9.gif">');
//                            alert(sessionStorage.getItem('history'));

                             $.post("http://"+location.hostname+"/searchresult/History", {searchhistory: sessionStorage.getItem('history')}, function(data) {
                                $("#history").html(data);
                                });
                            }
			});
		});


function setFilter_History(flg,pav,year_para_val,rtval)
{
chk=document.getElementsByName("selectResult_History");
var para="";

if (flg=="1")
    {

        para=pav;
    }
else if (flg=="2")
    {
for (var i=0; i < chk.length; i++)
	   {
			if (chk[i].checked==true)
			{
				if (para!="")
						{
							para=para+","
						}
				para= para + chk[i].value;
			}


		}
    }
    if (rtval!=undefined && rtval==true)
        {
            return para;
        }
            LoadData_History(para);
     if(para!=null && para!="")
         {loadMarker(map,para);} else {loadMarker(map,"");}

   // Calls the Chart function on click of each checkbox from right panel
 if($("#reportarea").is(":visible")==true){DrawChart(para,year_para_val);}
}



function LoadData_History(selectedvalues)
{



                                 $("#citation").html('<img src="/images/loading/loading9.gif">');

				$.post("http://"+location.hostname+"/citation/Index", {search: selectedvalues}, function(data) {
                                $("#citation").html(data);
                                });
}


